﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test2
{
    public delegate void OnRenewEventHandler();

    public class CommDataUnit
    {
        public static int AddrHead = 0;//在plc中的首地址

        public event OnRenewEventHandler OnRenew;

        public int Addr = 0;
        public ushort Data = 0;

        //public DataUnit SubData = null;


        public CommDataUnit()
        {

        }

        public CommDataUnit(int addr)
        {
            Addr = addr;
        }

        //原始数据暂定为uint
        public void UpdateData(ushort data)
        {
            Data = data;
            OnRenew?.Invoke();

        }
    }
}
